import {
	baseUrl
} from "@/utils/config.js"
// import request from '@/utils/request' // 引入 request
/* 文件上传接口封装 file.js */
const prefix = "/file"

export function uploadFile(file) {
	return uni.uploadFile({
		url: baseUrl + prefix + "/upload",
		file: file,
	}).then(result => {
		result = JSON.parse(result.data)
		if (result.code === 200) {
			return Promise.resolve(result); //返回成功 
		}
		return Promise.reject('uni.uploadFile调用失败')
	})
}